package com.androidx.p013lv.base.p014db;

import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import com.androidx.p013lv.base.bean.AdBaseBean;
import com.google.android.exoplayer2.text.ttml.TtmlNode;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import org.greenrobot.greendao.internal.DaoConfig;

/* renamed from: com.androidx.lv.base.db.AdBaseBeanDao */
public class AdBaseBeanDao extends AbstractDao<AdBaseBean, Long> {
    public static final String TABLENAME = "AD_BASE_BEAN";

    /* renamed from: com.androidx.lv.base.db.AdBaseBeanDao$Properties */
    public static class Properties {
        public static final Property AdNumber = new Property(6, Integer.TYPE, "adNumber", false, "AD_NUMBER");
        public static final Property AdPlaceEnum = new Property(2, String.class, "adPlaceEnum", false, "AD_PLACE_ENUM");
        public static final Property ClassifyId = new Property(4, Integer.TYPE, "classifyId", false, "CLASSIFY_ID");

        /* renamed from: Id */
        public static final Property f177Id = new Property(1, String.class, TtmlNode.ATTR_ID, false, "ID");
        public static final Property Idd = new Property(0, Long.class, "idd", true, "_id");
        public static final Property LoadTypeEnum = new Property(3, String.class, "loadTypeEnum", false, "LOAD_TYPE_ENUM");
        public static final Property RuleIntervalNum = new Property(5, Integer.TYPE, "ruleIntervalNum", false, "RULE_INTERVAL_NUM");
    }

    /* access modifiers changed from: protected */
    @Override // org.greenrobot.greendao.AbstractDao
    public final boolean isEntityUpdateable() {
        return true;
    }

    public AdBaseBeanDao(DaoConfig daoConfig) {
        super(daoConfig);
    }

    public AdBaseBeanDao(DaoConfig daoConfig, DaoSession daoSession) {
        super(daoConfig, daoSession);
    }

    public static void createTable(Database database, boolean z) {
        String str = z ? "IF NOT EXISTS " : "";
        database.execSQL("CREATE TABLE " + str + "\"AD_BASE_BEAN\" (\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,\"ID\" TEXT,\"AD_PLACE_ENUM\" TEXT,\"LOAD_TYPE_ENUM\" TEXT,\"CLASSIFY_ID\" INTEGER NOT NULL ,\"RULE_INTERVAL_NUM\" INTEGER NOT NULL ,\"AD_NUMBER\" INTEGER NOT NULL );");
    }

    public static void dropTable(Database database, boolean z) {
        StringBuilder sb = new StringBuilder();
        sb.append("DROP TABLE ");
        sb.append(z ? "IF EXISTS " : "");
        sb.append("\"AD_BASE_BEAN\"");
        database.execSQL(sb.toString());
    }

    /* access modifiers changed from: protected */
    public final void bindValues(DatabaseStatement databaseStatement, AdBaseBean adBaseBean) {
        databaseStatement.clearBindings();
        Long idd = adBaseBean.getIdd();
        if (idd != null) {
            databaseStatement.bindLong(1, idd.longValue());
        }
        String id = adBaseBean.getId();
        if (id != null) {
            databaseStatement.bindString(2, id);
        }
        String adPlaceEnum = adBaseBean.getAdPlaceEnum();
        if (adPlaceEnum != null) {
            databaseStatement.bindString(3, adPlaceEnum);
        }
        String loadTypeEnum = adBaseBean.getLoadTypeEnum();
        if (loadTypeEnum != null) {
            databaseStatement.bindString(4, loadTypeEnum);
        }
        databaseStatement.bindLong(5, (long) adBaseBean.getClassifyId());
        databaseStatement.bindLong(6, (long) adBaseBean.getRuleIntervalNum());
        databaseStatement.bindLong(7, (long) adBaseBean.getAdNumber());
    }

    /* access modifiers changed from: protected */
    public final void bindValues(SQLiteStatement sQLiteStatement, AdBaseBean adBaseBean) {
        sQLiteStatement.clearBindings();
        Long idd = adBaseBean.getIdd();
        if (idd != null) {
            sQLiteStatement.bindLong(1, idd.longValue());
        }
        String id = adBaseBean.getId();
        if (id != null) {
            sQLiteStatement.bindString(2, id);
        }
        String adPlaceEnum = adBaseBean.getAdPlaceEnum();
        if (adPlaceEnum != null) {
            sQLiteStatement.bindString(3, adPlaceEnum);
        }
        String loadTypeEnum = adBaseBean.getLoadTypeEnum();
        if (loadTypeEnum != null) {
            sQLiteStatement.bindString(4, loadTypeEnum);
        }
        sQLiteStatement.bindLong(5, (long) adBaseBean.getClassifyId());
        sQLiteStatement.bindLong(6, (long) adBaseBean.getRuleIntervalNum());
        sQLiteStatement.bindLong(7, (long) adBaseBean.getAdNumber());
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public Long readKey(Cursor cursor, int i) {
        int i2 = i + 0;
        if (cursor.isNull(i2)) {
            return null;
        }
        return Long.valueOf(cursor.getLong(i2));
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public AdBaseBean readEntity(Cursor cursor, int i) {
        int i2 = i + 0;
        Long valueOf = cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2));
        int i3 = i + 1;
        String string = cursor.isNull(i3) ? null : cursor.getString(i3);
        int i4 = i + 2;
        String string2 = cursor.isNull(i4) ? null : cursor.getString(i4);
        int i5 = i + 3;
        return new AdBaseBean(valueOf, string, string2, cursor.isNull(i5) ? null : cursor.getString(i5), cursor.getInt(i + 4), cursor.getInt(i + 5), cursor.getInt(i + 6));
    }

    public void readEntity(Cursor cursor, AdBaseBean adBaseBean, int i) {
        int i2 = i + 0;
        String str = null;
        adBaseBean.setIdd(cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2)));
        int i3 = i + 1;
        adBaseBean.setId(cursor.isNull(i3) ? null : cursor.getString(i3));
        int i4 = i + 2;
        adBaseBean.setAdPlaceEnum(cursor.isNull(i4) ? null : cursor.getString(i4));
        int i5 = i + 3;
        if (!cursor.isNull(i5)) {
            str = cursor.getString(i5);
        }
        adBaseBean.setLoadTypeEnum(str);
        adBaseBean.setClassifyId(cursor.getInt(i + 4));
        adBaseBean.setRuleIntervalNum(cursor.getInt(i + 5));
        adBaseBean.setAdNumber(cursor.getInt(i + 6));
    }

    /* access modifiers changed from: protected */
    public final Long updateKeyAfterInsert(AdBaseBean adBaseBean, long j) {
        adBaseBean.setIdd(Long.valueOf(j));
        return Long.valueOf(j);
    }

    public Long getKey(AdBaseBean adBaseBean) {
        if (adBaseBean != null) {
            return adBaseBean.getIdd();
        }
        return null;
    }

    public boolean hasKey(AdBaseBean adBaseBean) {
        return adBaseBean.getIdd() != null;
    }
}
